#ifndef FRUSTRUMCULLER_H
#define FRUSTRUMCULLER_H
#include "includes.h"

#include "chunk.h"
#define FRUSTRUM_CULL_THRESHOLD -8

class CameraManager
{
    float frustum[6][4];
    vector3<float> lookAtVector, eyeVector, upVector, strideVector;

    float roty,rotx;

public:
    CameraManager();
    void GetCurrentFrustrum();
    bool PtInFrustrum(float x, float y, float z);
    bool ChunkInFrustrum(Chunk& c);
    vector3<float>& getLookAtVector();
    vector3<float>& getEyeVector();
    vector3<float>& getUpVector();
    vector3<float>& getStrideVector();
    void lookAt(vector3<float> center, float dist);
    void panLeft(float amt);
    void panRight(float amt);
    void panUp(float amt);
    void panDown(float amt);
    void goLeft(float amt);
    void goRight(float amt);
    void goUp(float amt);
    void goDown(float amt);
    void goForward(float amt);
    void goBack(float amt);
    void reset();

    float getEyeX();
    float getEyeY();
    float getEyeZ();

    float getRotY();
    float getRotX();

};

#endif // FRUSTRUMCULLER_H
